//https://leetcode.cn/problems/is-unique-lcci/

class Solution {
public:
    bool isUnique(string astr) {
        if (astr.size() > 26)
            return false;

        int bitarray = 0;
        for (auto e : astr)
        {
            if ((bitarray >> (e - 'a')) & 1 == 1)
                return false;

            bitarray |= (1 << (e - 'a'));

        }

        return true;

    }
};